package com.licode.codekit.buildprj;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;

import javax.annotation.Nullable;
import javax.swing.*;

/**
 * @author licode
 */
public class CreateModuleUI extends DialogWrapper {
    private final String addPrjDir;
    private final Project rootProject;
    private final CreateModuleUiBuilder moduleUiBuilder = new CreateModuleUiBuilder();

    public CreateModuleUI(@Nullable Project project, String addPrjDir) {
        super(project);
        this.setTitle("小码咨询编程助手-新增模块");
        this.rootProject = project;
        this.addPrjDir = addPrjDir;

        this.init();
    }

    protected JComponent createNorthPanel() {
        return this.moduleUiBuilder.initNorth();
    }

    protected JComponent createSouthPanel() {
        return null;
    }

    protected JComponent createCenterPanel() {
        return this.moduleUiBuilder.initCenter(this.rootProject, addPrjDir,this);
    }
}
